<?php
// +----------------------------------------------------------------------
// | ebSIG
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.ebsig.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: liudaojian <liudaojian@ebsig.com>
// +----------------------------------------------------------------------

/**
 * 公共路由
 * @author   liudaojian <liudaojian@ebsig.com>
 * @version 1.0
 */

namespace App\Http\Routes;

use Illuminate\Contracts\Routing\Registrar;

class CommonRoutes
{

    public function map(Registrar $router)
    {

        $router->group(['prefix' => 'lar/'], function($router) {
            $router->get('user/login', 'Common\UserController@index');
            $router->get('user/login/do', 'Common\UserController@login');
            $router->get('user/logout', 'Common\UserController@logout');
            
            //页面跟踪
            $router->get('tracker', 'Common\TrackerController@index');
            
            //获取地理位置
            $router->get('location/ip', 'Common\LocationController@ip'); //根据ip地址获取地址信息
            $router->get('location/coordinate', 'Common\LocationController@coordinate'); //根据经纬度获取地址信息
            $router->get('geocoder/address', 'Common\LocationController@address'); //地址解析

            //获取图片验证码
            $router->get('kit/captcha', 'Common\KitController@captcha');

            //文件上传
            $router->post('upload', 'Common\UploadController@upload');

            //发送手机验证码
            $router->get('send/sms', 'Common\SmsController@sendSms');

            //获取省市区
            $router->get('region/getProvince', 'Common\RegionController@getProvince');
            $router->get('region/getCity', 'Common\RegionController@getCity');
            $router->get('region/getCountry', 'Common\RegionController@getCountry');

            //微信oauth2授权
            //$router->get('wx/oauth', 'Common\WxOAuthController@send');


            //支付宝
            $this->alipay($router);

        });

    }

    /**
     * 支付宝路由
     * @param $router
     */
    private function alipay($router)
    {

        $router->get('alipay/customer/card/check', 'Alipay\AlipayCustomerCardController@check'); //会员卡领卡页
        $router->get('alipay/customer/card/complete', 'Alipay\AlipayCustomerCardController@complete'); //领卡完成页
        $router->get('alipay/customer/card/apply', 'Alipay\AlipayCustomerCardController@apply'); //领取会员卡
        $router->get('alipay/auth', 'Alipay\AlipayOauthController@send'); //支付宝授权
        $router->get('alipay/auth/notify', 'Alipay\AlipayOauthController@notify'); //支付宝授权异步通知

    }


}